<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="" />
    <meta name="author" content="" />
    <title>在线考试系统控制台-课程管理</title>
    <link rel="stylesheet" th:href="@{https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css}" />
    <!--<link th:href="@{https://cdn.bootcss.com/bootstrap/3.0.0/css/bootstrap.min.css}" rel="stylesheet" />-->
    <link th:href="@{https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css}" rel="stylesheet" />
    <link th:href="@{/css/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css}" rel="stylesheet" />
    <link rel="stylesheet" th:href="@{/css/manage/manage-app.css}" />

    <script type="text/javascript" th:src="@{https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js}"></script>
    <!--<script th:src="@{https://cdn.bootcss.com/jquery/1.8.3/jquery.min.js}"></script>-->
    <script type="text/javascript" th:src="@{https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js}"></script>
    <!--<script type="text/javascript" th:src="@{https://cdn.bootcss.com/bootstrap/3.0.0/js/bootstrap.min.js}"></script>-->
    <script type="text/javascript" th:src="@{/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js}"></script>
    <!--<script type="text/javascript" th:src="@{https://cdn.bootcss.com/moment.js/2.20.1/moment.min.js}"></script>-->
    <script type="text/javascript" th:src="@{/js/bootstrap-datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js}"></script>
    <script type="text/javascript" th:src="@{/js/manage/manage-app.js}"></script>
    <script type="text/javascript" th:src="@{/js/manage/manage-postBoard.js}"></script>
</head>

<body>

    <nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
        <a class="navbar-brand" href="#"><img style="width: 32px;height: 32px;" th:src="@{/img/manage-logo.png}" /></a>
        <a class="navbar-brand" href="#">在线考试系统控制台</a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
        <ul class="nav navbar-nav navbar-right">
        <li class="dropdown">
        <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
        <img class="img-circle" style="width: 32px;height: 32px;" th:src="@{'/upload/images/'+${current_account.avatarImgUrl}}" />&nbsp;&nbsp;<span th:text="${current_account.name}"></span>
        <span class="caret"></span>
        </a>
        <ul class="dropdown-menu">
        <li><a href="javascript:void(0);">修改密码</a></li>
        <li><a id="logout">退出系统</a></li>
        </ul>
        </li>
        </ul>
    </div>
    </div>
    </nav>

    <div class="container-fluid">
    <div class="row">
    <div class="col-sm-3 col-md-2 sidebar">
    <ul class="nav nav-sidebar">
    <li><a th:href="@{/manage/contest/list}"><i class="fa fa-tv"></i>&nbsp;考试管理</a></li>
    <li><a th:href="@{/manage/question/list}"><span class="glyphicon glyphicon-list-alt"></span>&nbsp;题目管理</a></li>
    <li><a th:href="@{/manage/subject/list}"><span class="glyphicon glyphicon-book"></span>&nbsp;课程管理</a></li>
    <li><a th:href="@{/manage/result/contest/list}"><span class="glyphicon glyphicon-signal"></span>&nbsp;成绩管理</a></li>
    <li><a th:href="@{/manage/account/list}"><span class="glyphicon glyphicon-user"></span>&nbsp;用户管理</a></li>
    <li class="active"><a href="#"><i class="fa fa-paper-plane"></i>&nbsp;帖子管理<span class="sr-only">(current)</span></a></li>
    <li><a th:href="@{/manage/comment/list}"><i class="fa fa-commenting-o"></i>&nbsp;评论管理</a></li>
    </ul>
    </div>
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <h1 class="page-header">帖子管理</h1>
    <div class="row" style="margin-bottom: 5px;">
    <div class="col-md-10">
    </div>
    <div class="col-md-2">
    </div>
    </div>
    <div class="table-responsive">
    <table class="table table-striped table-bordered">
    <thead>
    <tr>
    <th>标题</th>
    <th>发布者</th>
    <th>创建时间</th>
    <th>编辑时间</th>
    <th>最后一次回复时间</th>
    <th>回帖数</th>
    <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="item,itemStats : ${data['posts']}">
    <td th:text="${item.title}" width="400px"></td>
    <td th:text="${item.author.name}"></td>
    <td th:text="${#dates.format(item.createTime, 'yyyy-MM-dd HH:mm:ss')}">2018-1-11 09:00:00</td>
    <td th:text="${#dates.format(item.updateTime, 'yyyy-MM-dd HH:mm:ss')}">2018-1-11 11:00:00</td>
    <td th:if="${item.lastReplyTime != null}" th:text="${#dates.format(item.lastReplyTime, 'yyyy-MM-dd HH:mm:ss')}">2018-1-11 11:00:00</td>
    <td th:if="${item.lastReplyTime == null}" th:text="'--'">2018-1-11 11:00:00</td>
    <td th:text="${item.replyNum}"></td>
    <td>
        <button type="button" class="btn btn-danger btn-xs" th:onclick="'managePostBoardPage.deletePostAction('+${item.id}+')'"><i class="fa fa-trash"></i>删除</button>
    </td>
    </tr>
    </tbody>
    </table>
    </div>
    <div class="row">
    <div class="col-md-9" id="subPageHead">
    </div>
    <div class="col-md-3">
    </div>
    </div>
    </div>
    </div>
    </div>
<script th:inline="javascript">
    /*<![CDATA[*/
    var pageNum = /*[[${data['pageNum']}]]*/;
    var pageSize = /*[[${data['pageSize']}]]*/;
    var totalPageNum = /*[[${data['totalPageNum']}]]*/;
    var totalPageSize = /*[[${data['totalPageSize']}]]*/;
    var posts = /*[[${data['posts']}]]*/;
    var contextPath = /*[[${#httpServletRequest.getContextPath()}]]*/;

    $(function(){
        app.init(contextPath);
        managePostBoardPage.init(pageNum, pageSize, totalPageNum, totalPageSize, posts);
    });
    /*]]>*/
</script>
</body>
</html>

